let myHandler = async function (event, context, callback, logger) {
  logger.info(event);

  // do something here
  let num1: number = 0
  let num2: number = 0
  let operator: string = ''

  if (event.body) {
    let _body = JSON.parse(event.body)
    num1 = _body.num1
    num2 = _body.num2
    operator = _body.operator
  } else {
    num1 = event.num1
    num2 = event.num2
    operator = event.operator
  }
  let compute: number = 0
  switch (operator) {
    case '+':
      compute = num1 + num2
      break
    case '-':
      compute = num1 - num2
      break
    case '*':
      compute = num1 * num2
      break
    case '/':
      compute = Number((num1 / num2).toFixed(2))
      break
    default :

  }

  callback({
    code: 0,
    desc: "Success.",
    body: {
      result: compute
    }
  });
};

export { myHandler };